#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int i = 0;
	int n1 = n;
	int sum = 0;
	for (i = 0; i < 5; i++)
	{
		sum = sum + n;
		n = n1 + n * 10;
	}
	printf("%d\n", sum);
	return 0;
}